function postRequest(strURL){
	var xmlHttp;
	if(window.XMLHttpRequest){ // For Mozilla, Safari, ...
		var xmlHttp = new XMLHttpRequest();
	}
	else if(window.ActiveXObject){ // For Internet Explorer
		var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlHttp.open('POST', strURL, true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.onreadystatechange = function(){
		if (xmlHttp.readyState == 4){
				updatepage(xmlHttp.responseText);
		}
	}
	xmlHttp.send(strURL);
}

function updatepage(str){
	if(str=="validLogin"){}
	}else{
		window.location="/privr/index.php";
	}
}


function sessionvalidate(){
	var username = readCookie('username');
	alert(username);
	var password = readCookie('password');
	var token = readCookie('token');
	var url = "php/sessionvalidate.php?username=" + username + "&password=" + password + "&token=" + token;
	postRequest(url);
}
alert(username);
sessionvalidate();